<!DOCTYPE html>
<html lang="en">

<head>
    {include file="common/meta_new" /}
</head>

<body class="F6">
    <div id="app" class="index-page">
        <!-- 头部 -->
        <div class="header-box">
            <div class="circle1"></div>
            <div class="circle2"></div>
            {if $user}
            <div class="user-box">
                <div class="avatar">
                    <img src="{$user['avatar']}" alt="">
                </div>
                <div class="nickname-box">
                    <div class="nickname ellipsis-1">{$user['nickname']}</div>
                    <div class="tag-name">
                        {$user['expert_level']|doExpertLevel}
                    </div>
                </div>
            </div>
            {else /}
            <div class="user-box" onclick="gotoLogin()">
                <div class="avatar">
                    <img src="/assets/img/avatar.png" alt="">
                </div>
                <div class="nickname-box">
                    <div class="nickname ellipsis-1"  >请登陆</div>
                    <div class="tag-name">
                        未登陆
                    </div>
                </div>
            </div>
            {/if}
            <div class="erji">
                <img src="/static/images/erji.png" alt="">
            </div>
            <div class="banner">
                <div class="carousel-container" id="carousel1">
                    <div class="carousel-wrapper">
                        {volist name="head_ad_list" id="vo"}
                        <a href="#" class="carousel-item">
                            <img src="{$vo.cover}" alt="">
                        </a>
                        {/volist}
                    </div>
                    <div class="carousel-dots"></div>
                </div>
            </div>
            <div class="notice-box">
                <div class="notice-label">通知<span>消息</span></div>
                <div onclick="gotoNoticelist()" class="notice-text ellipsis-1">{if $notice}{$notice["title"]}{/if}</div>
            </div>
        </div>
        <!-- 视频号学院 -->
        <div class="video-box">
            <div class="bg">
                <img src="/static/images/video-bg1.png" alt="">
            </div>
            <div class="content">
                <div class="top">
                    <div class="title">视频号学院</div>
                    <div class="more-box">
                        <div class="point"></div>
                        <div onclick="gotoShoollist()" class="text">更多</div>
                    </div>
                </div>
                <div class="article-list">

                    {volist name="article_list" id="vo"}

                    <a href="javascript:gotoDetail('{$vo.id}')" class="article-item">
                        <div class="left">
                            <div class="title ellipsis-2">{$vo.title}</div>
                            <div class="bottom">
                                <div class="time-box">
                                    <img src="/static/images/time.png" alt="">
                                    <span>{:date('Y-m-d', $vo.createtime)}</span>
                                </div>
                                <div class="right-text">{$vo.category_name}</div>
                            </div>
                        </div>
                        <div class="right"><img src="{$vo.cover}" alt=""></div>
                    </a>

                    {/volist}
                </div>
            </div>
        </div>
        <!-- 精选推荐 -->
        <div class="recommend-box">
            <div class="title">
                <div class="left"></div>
                <div class="middle">精选推荐</div>
                <div class="right"></div>
            </div>
            <div class="list">

                {volist name="recommand_goods_list" id="vo"}
                <div class="item">
                    <div class="product-image">
                        <img src="{$vo.img}" alt="">
                    </div>
                    <div class="product-title ellipsis-1">{$vo.name}</div>
                    <div class="bottom">
                        <div class="point-box">
                            <span>{$vo.min_price}</span>
                        </div>
                        <a href="#" class="btn">立即购买</a>
                    </div>
                </div>
                {/volist}
            </div>
        </div>

        {include file="common/foot_new" /}

    </div>
    <script src="/static/js/common.js"></script>
    <script>
        new Carousel('carousel1', 3000);
        new Carousel('carousel2', 4000);

        function gotoShoollist() {
            window.location.href = "{:url('index/School/index','','',true)}";
        }
        function gotoNoticelist() {
            window.location.href = "{:url('index/Notice/index','','',true)}";
        }
        function gotoLogin() {
            window.location.href = "{:url('index/user/login','','',true)}";
        }
        function gotoDetail(id) {
            window.location.href = "{:url('index/School/detail','','',true)}?id=" + id;
        }
    </script>
</body>

</html>